home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Format CD 23
/
Amiga Format AFCD23 (Feb 1998, Issue 107).iso
/
-seriously_amiga-
/
shareware
/
programming
/
e
/
easyplugins
/
examples
/
dclistview_demo.e
next >
Wrap
Text File
|
1997-12-06
|
2KB
|
51 lines
OPT PREPROCESS, OSVERSION=37
MODULE 'tools/exceptions', 'tools/EasyGUI', 'exec/nodes', 'exec/lists',
'easyplugins/dclistview', 'tools/constructors'
DEF result=-1
PROC main() HANDLE
DEF dclist:PTR TO dclistview_plugin
DEF list, a, nodes
list:=newlist()
nodes:=['zero','one','two','three','four','five','six','seven',
'eight','nine','ten','eleven','twelve','thirteen','fourteen']
ForAll({a}, nodes, `AddTail(list, newnode(NIL, a)))
NEW dclist.dclistview('L_abel', 15,7, list,result,"a",FALSE)
easyguiA('Double Click test',
[EQROWS,
[DCLIST, {listaction},dclist,TRUE], ->note use of ID constant (=PLUGIN)
[EQCOLS,
[SBUTTON, {okaction}, '_OK', dclist, "o"],
[SBUTTON, {disabler}, '_Disable', dclist, "d"],
[SBUTTON, {cancelaction}, '_Cancel', NIL, "c"]
]
])
EXCEPT DO
END dclist
IF exception<>"QUIT" THEN report_exception()
ENDPROC
PROC listaction(info, dclist:PTR TO dclistview_plugin)
IF dclist.clicked THEN okaction(dclist, NIL)
PrintF('Current Selection: \d\n',dclist.current)
ENDPROC
PROC okaction(dclist:PTR TO dclistview_plugin, info)
IF (result:=dclist.current)= -1
PrintF('No selection made\n')
cancelaction(info)
ENDIF
PrintF('Final Selection: \d\n',result)
quitgui(result)
ENDPROC
PROC disabler(dclist:PTR TO dclistview_plugin, info) IS dclist.setdisabled(dclist.disabled=FALSE)
PROC cancelaction(info)
PrintF('Operation cancelled.\n')
quitgui()
ENDPROC